package code

import "fmt"

func ProcessIf1() {
	var v int = 700
	if v < 1000 {
		fmt.Println("v is less than 1000")
	} else {
		fmt.Println("v is greater than 1000")
	}
}

func ProcessIf2() {
	var hp int = 0
	if hp > 100 {
		fmt.Println("玩家很健康")
	} else if hp > 50 {
		fmt.Println("玩家快没血了")
	} else if hp > 10 {
		fmt.Println("玩家快死了")
	} else {
		fmt.Println("玩家死了")
	}
}

func ProcessIf3() {
	if a := 10; a > 5 {
		fmt.Println(a)
		return
	}

	// a会报错
	// fmt.Println(a)
}
